from todo_api_project.base.myBase import Tools

class reg_model(Tools):
    # 定义路径
    path = '/user/register'

    # 发送注册请求
    def reg_action(self, usr, pwd, cpwd, email, check='1234'):
        mydata = {
            "username": usr,
            "password": pwd,
            "cpassword": cpwd,
            "checkcode": check,
            "email": email
        }
        print(self.hosturl + self.path)
        res = self.huihua.post(url=self.hosturl+self.path, data=mydata)
        return res.json()

# import requests
# s = requests.session()
# reg = reg_model(huihua=s)
# msg = reg.reg_action(usr='aadadadahgfa',pwd='qwer123',cpwd='qwer123',check='1234',email='dsadasdsd@qq.com')
# print(msg)